#!/bin/bash
case $# in
    1) 
        img="$1";;
    0)
        img="registry.cn-beijing.aliyuncs.com/zjjliujs1/ubuntu-18.04:latest";;
    *)
        echo "Usage: <command> [<image name>:<image tag>]"
        exit -1
esac
echo "Run image ${img}..."

hostRoot="${HOME}"
clientUser="ljs"
clientHome="/home/ljs"

echo run docker image ${img}

docker run \
    --net host \
    --rm \
    -v ${hostRoot}/bin:${clientHome}/bin \
    -v ${hostRoot}/download:${clientHome}/download \
    -v ${hostRoot}/caffes:${clientHome}/caffes \
    -v ${hostRoot}/tmp:${clientHome}/tmp \
    -v ${hostRoot}/exer:${clientHome}/exer \
    -u ${clientUser} \
    -w ${clientHome} \
    -it \
    ${img}
